package com.zhuss.bean.bo.team.publish;

import com.zhuss.common.BaseBo;
import com.zhuss.common.IdBo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @Author: zhushanshuo
 * @Date: 2020/3/30 15:41
 */
public class CreatePublishBo extends IdBo implements Serializable, BaseBo {
    private Integer sendType;

    private Long investId;

    private String investName;

    private Date startTime;

    private Date endTime;

    private List<List<Long>> companyId;

    private List<Long> companyIdList;

    private List<Long> userIdList;

    private String companyName;

    private String person;

    private Integer status;

    private Integer sort;

    private Integer area;

    public Integer getSendType() {
        return sendType;
    }

    public void setSendType(Integer sendType) {
        this.sendType = sendType;
    }

    public Long getInvestId() {
        return investId;
    }

    public void setInvestId(Long investId) {
        this.investId = investId;
    }

    public String getInvestName() {
        return investName;
    }

    public void setInvestName(String investName) {
        this.investName = investName;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getCompanyId() {
        StringBuffer sb = new StringBuffer();
        companyIdList = new ArrayList<>();
        userIdList = new ArrayList<>();
        for (List<Long> item : companyId) {
            companyIdList.add(item.get(0));
            if (item.size() < 2){
                continue;
            }else {
                userIdList.add(item.get(1));
            }
        }
        if (companyIdList != null && companyIdList.size() > 0) {
            for (Long item : companyIdList) {
                sb.append(item);
                sb.append(",");
            }
            sb.deleteCharAt(sb.lastIndexOf(","));
        }
        return sb.toString();
    }

    public void setCompanyId(List<List<Long>> companyId) {
        this.companyId = companyId;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getPerson() {
        StringBuffer sb = new StringBuffer();
        if (userIdList != null && userIdList.size() > 0) {
            for (Long item : userIdList) {
                sb.append(item);
                sb.append(",");
            }
            sb.deleteCharAt(sb.lastIndexOf(","));
        }
        return sb.toString();
    }

    public void setPerson(String person) {
        this.person = person;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Integer getArea() {
        area = getConcurrentArea();
        return area;
    }

    public void setArea(Integer area) {
        this.area = area;
    }
}
